import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/views/Home.vue'

Vue.use(Router)

import testRouter from './modules/test'
import hideRouter from './modules/hide'
import mealRouter from './modules/meal'
import merchantsRouter from './modules/merchants'
import searchRouter from './modules/search'

export const constantRouterMap = [
  {
    path: '/',
    name: 'home',
    component: Home,
  },
  ...testRouter,
  ...hideRouter,
  ...mealRouter,
  ...merchantsRouter,
  ...searchRouter,
]
export function createRouter () {
  return new Router({
    mode: 'history',
    scrollBehavior: () => ({ y: 0 }),
    routes: constantRouterMap
  })
}
export const asyncRouterMap = [

  { path: '*', redirect: '/404', hidden: true }
]
